﻿<%@ Page Language="C#" MasterPageFile="~/Admin/Membership.master" AutoEventWireup="true" CodeFile="access_rules.aspx.cs" Inherits="Admin_MembershipProvider_Access_access_rules" Title="Access Rules" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<%@ Register Src="~/Admin/MembershipProvider/Access/Controls/AccessRules.ascx" TagName="AccessNav" TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<br />
<table>
       <tr>
            <th>
                Website Access Rules
            </th>
        </tr>
      <tr><td> <uc1:AccessNav ID="ucAccessNav" runat="server" /></td></tr>
       
        <tr>
            <td>
                	
		
		<table>
		    <tr>
		        <td valign="top">
		            <div >
				    <asp:TreeView runat="server" ID="FolderTree"
					OnSelectedNodeChanged="FolderTree_SelectedNodeChanged">
					<RootNodeStyle ImageUrl="~/Admin/MembershipProvider/Access/i/folder.gif" />
					<ParentNodeStyle ImageUrl="~/Admin/MembershipProvider/Access/i/folder.gif" />
					<LeafNodeStyle ImageUrl="~/Admin/MembershipProvider/Access/i/folder.gif" />
					<SelectedNodeStyle Font-Underline="true" ForeColor="#A21818" />
				</asp:TreeView>
				</div> 
		        </td>
		        <td valign="top" style="padding-left: 30px; border-left: 1px solid #999;">
		            	<asp:Panel runat="server" ID="SecurityInfoSection" Visible="false">
				<h2 runat="server" id="TitleOne" ></h2>
				
				<p>
				Rules are applied in order. The first rule that matches applies, and the permission in each rule overrides the permissions in all following rules. Use the Move Up and Move Down buttons to change the order of the selected rule. Rules that appear dimmed are inherited from the parent and cannot be changed at this level. 
				</p>
					
				<telerik:RadGrid ID="RulesGrid" runat="server" AutoGenerateColumns="false" 
                                onitemdatabound="RulesGrid_ItemDataBound"  >
				    <MasterTableView>
				    <AlternatingItemStyle CssClass="RadGridAltr" />
				    
				        <Columns>				          
				               <telerik:GridTemplateColumn HeaderText="Action">				               
				                <ItemTemplate>
				                    <%# GetAction((System.Web.Configuration.AuthorizationRule)Container.DataItem) %>
				                </ItemTemplate>
				            </telerik:GridTemplateColumn >
				               <telerik:GridTemplateColumn HeaderText="Roles">
				                <ItemTemplate>
				               	<%# GetRole((System.Web.Configuration.AuthorizationRule)Container.DataItem) %>
				                </ItemTemplate>
				            </telerik:GridTemplateColumn >
				               <telerik:GridTemplateColumn HeaderText="User">
				                <ItemTemplate>
				                 <%# GetUser((System.Web.Configuration.AuthorizationRule)Container.DataItem) %>
				                </ItemTemplate>
				            </telerik:GridTemplateColumn>
				               <telerik:GridTemplateColumn HeaderText="Move Rule">
				                <ItemTemplate>
				                   <asp:Button ID="Button2" runat="server" Text="  Up  " CommandArgument="<%# (System.Web.Configuration.AuthorizationRule)Container.DataItem %>" OnClick="MoveUp" />
								<asp:Button ID="Button3" runat="server" Text="Down" CommandArgument="<%# (System.Web.Configuration.AuthorizationRule)Container.DataItem %>" OnClick="MoveDown" />
				                </ItemTemplate>
				            </telerik:GridTemplateColumn>
				              <telerik:GridTemplateColumn HeaderText="Delete Rule">
				                <ItemTemplate>
				                    <asp:Button ID="Button1" runat="server" Text="Delete Rule" CommandArgument="<%# (System.Web.Configuration.AuthorizationRule)Container.DataItem %>" OnClick="DeleteRule" OnClientClick="return confirm('Click OK to delete this rule.')" />
				                </ItemTemplate>
				            </telerik:GridTemplateColumn>
				            
				        </Columns>
				    </MasterTableView>
				</telerik:RadGrid>
		

				<br />
				<hr />
				<h2 runat="server" id="TitleTwo" class="alert"></h2>
				<b>Action:</b>
				<asp:RadioButton runat="server" ID="ActionDeny" GroupName="action" 
					Text="Deny" Checked="true" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				<asp:RadioButton runat="server" ID="ActionAllow" GroupName="action" 
					Text="Allow" />
				
				<br /><br />
				<b>Rule applies to:</b>
				<br />
				<asp:RadioButton runat="server" ID="ApplyRole" GroupName="applyto"
					Text="This Role:" Checked="true" />
				<asp:DropDownList ID="UserRoles" runat="server" AppendDataBoundItems="true">
				<asp:ListItem>Select Role</asp:ListItem>
				</asp:DropDownList>
				<br />
					
				<asp:RadioButton runat="server" ID="ApplyUser" GroupName="applyto"
					Text="This User:" />
				<asp:DropDownList ID="UserList" runat="server" AppendDataBoundItems="true">
				<asp:ListItem>Select User</asp:ListItem>
				</asp:DropDownList>	
				<br />
				
				
				<asp:RadioButton runat="server" ID="ApplyAllUsers" GroupName="applyto"
					Text="All Users (*)"  />
				<br />
				
				
				<asp:RadioButton runat="server" ID="ApplyAnonUser" GroupName="applyto"
					Text="Anonymous Users (?)"  />
				<br /><br />
				
				<asp:Button ID="Button4" runat="server" Text="Create Rule" OnClick="CreateRule"
					OnClientClick="return confirm('Click OK to create this rule.');" />
					
				<asp:Literal runat="server" ID="RuleCreationError"></asp:Literal>
			</asp:Panel>
		        </td>
		    </tr>
		</table>
            </td>
        </tr>
    </table>
</asp:Content>

